<script setup lang="ts">
import {onActivated, onDeactivated, ref} from "vue";

const msg=ref('');

onActivated(()=>{
  console.log('Tab2组件被活过来了');
});

onDeactivated(()=>{
  console.log('Tab2组件死去');
});


</script>

<template>
    <input type="text" v-model="msg" >
    <div>输入的是: {{ msg}}</div>
</template>

<style scoped>

</style>